//
//  CarDetailmodel.m
//  CarTown
//
//  Created by xionghao on 15/8/17.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "CarDetailmodel.h"
#import <MJExtension.h>
@implementation CarDetailmodel
+(instancetype)carWithdict:(NSDictionary *)dict{
   
    [CarDetailmodel setupObjectClassInArray:^NSDictionary *{
        return @{@"con_car":@"CarDetailmodel"};
    }];
   
   CarDetailmodel *car= [CarDetailmodel objectWithKeyValues:dict];
  
//    if (car.imgs.count>0) {
//        NSMutableArray *mimgs=[NSMutableArray array];
//        for (NSString *imgstr in car.imgs) {
//            [mimgs addObject:imgstr];
//        }
//        car.imgs=mimgs;
//    }
//    if (car.con_car.count>0) {
//        NSMutableArray *mconcar=[NSMutableArray array];
//        for (NSDictionary  *detaildict in car.con_car) {
//            CarDetailmodel *car=[[CarDetailmodel alloc]init];
//            [car setValuesForKeysWithDictionary:detaildict];
//            [mconcar addObject:car];
//        }
//        car.con_car=mconcar;
//    }
    
    NSString *regex = @"[\\d]+[.]00";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    BOOL isValid = [predicate evaluateWithObject:car.sysprice];
    if (isValid) {
        NSInteger price=[car.sysprice integerValue] ;
        car.sysprice=[NSString stringWithFormat:@"%ld",price];
    }
    return car;
}
+(NSDictionary *)replacedKeyFromPropertyName{
    return @{@"ID":@"id"};
}


@end
